package pack0924;

import java.util.Arrays;

public class DemoB {
    //引用关系
    public static void a() {
        //原始数据类型
        char a = 5;
        char b = 6;
        char c = 2;
        char d = 65;
        int[] arr = {a, b, c, d};//按指传递
        System.out.println(Arrays.toString(arr));
        c = 9;
        System.out.println(Arrays.toString(arr));
    }

    public static void b() {
        //一些特殊的引用类型，也是按值传递。
        String a = "hy";
        String b = "dy";
        String c = "wy";
        String d = "by";
        String[] arr = {a, b, c, d};
        System.out.println(Arrays.toString(arr));
        c = "my";
        System.out.println(Arrays.toString(arr));
    }

    public static void main(String[] args) {
        b();
    }
}
